package com.study.demo.service;

import com.study.demo.dao.DogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

@Service
public class DogService {
    private  DogRepository dogRepository;

    @Autowired
    public DogService(DogRepository dogRepository) {
        this.dogRepository = dogRepository;
    }

    public void hello() {
        System.out.println("执行了DogRepository中的hello方法");
        dogRepository.hello();
    }
}

